package com.zzhua.feign;

import com.zzhua.entity.Student;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.context.annotation.Primary;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.Collection;

// 使用Feign,来进行一个远程调用
// fallback指定访问失败时的回调处理, 还需要再yml中开启feign.hystrix
@FeignClient(value = "provider",fallback = FeignError.class)
@Primary //消除警告
public interface FeignProviderClient {

    @GetMapping("/student/findAll")
    Collection<Student> findAll();

    @GetMapping("/student/port")
    String port();
}
